import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;

public class MyJPanel extends JPanel {
    private ArrayList<Ball> balls;


    public void setBall(ArrayList<Ball> balls) {
            this.balls=balls;
    }

    @Override
    public void paint(Graphics g) {
        for (Ball ball:balls){
            g.setColor(ball.getColor());
            g.fillOval((int) ball.getX(), (int)ball.getY(), (int)ball.getR() * 2, (int)ball.getR() * 2);
        }
    }

}
